<ion-view view-title="客户编辑">
  <ion-nav-buttons side="left">
    <button class="button button-clear button-positive" ng-click="goBack()">
      客户资料
    </button>
  </ion-nav-buttons>
  <ion-content>

    <ion-list type="list-inset">
      <div class="item-divider padding-left4 item-divider-icon-right">
        <span>名片</span>
        <i class="icon ion-ios-plus-outline positive" ng-click="addCard()"></i>
      </div>
      <ion-item class="item item-text-wrap item-remove-animate no-lrborder item-padding-left4 fix-item-content"
                ng-repeat="card in currentCustomer.cards" ng-click="editCard(card)">
        <div>
          <label>{{card.dt}}</label>
          <label>{{card.duty}}</label>
          <i class="icon icon-right ion-flag float-right" ng-show="currentCustomer.cardId==card.id"></i>
        </div>
        <ion-option-button class="button-assertive center" ng-click="deleteCard(card)">
          <i class="icon ion-android-close center"></i>
        </ion-option-button>
        <ion-option-button class="button-balanced center" ng-click="setMainCard(card)">
          <i class="icon ion-android-done center"></i>
        </ion-option-button>
      </ion-item>

    </ion-list>

    <!--<div ng-include="'templates/share_option.html'"></div>-->

    <ul class="list list-inset">
      <li class="item-divider padding-left4">
        <span>共享</span>
      </li>
      <li class="item item-toggle no-lrborder item-padding-left4" ng-if="!showShareOption()">
        正在加载客户共享信息
      </li>
      <li class="item item-toggle no-lrborder item-padding-left4" ng-if="showShareOption()">
        所有同事
        <label class="toggle toggle-balanced">
          <input type="checkbox" ng-model="currentCustomer.isGlobal" ng-true-value="'1'" ng-false-value="'0'"
                 ng-change="setIsGlobal()">

          <div class="track">
            <div class="handle"></div>
          </div>
        </label>
      </li>
      <li ng-if="showShareOption()">
        <a class="item no-lrborder item-padding-left4 item-icon-right" ng-click="goShareDep()">
          <label>指定部门</label>
          <label class="float-right">{{departmentLabel}}</label>
          <i class="icon icon-right ion-ios-arrow-right"></i>
        </a>
      </li>
      <li ng-if="showShareOption()">
        <a class="item no-lrborder item-padding-left4 item-icon-right" ng-click="goSharePer()">
          <label>指定同事</label>
          <label class="float-right">{{shareUserLabel}}</label>
          <i class="icon icon-right ion-ios-arrow-right"></i>
        </a>
      </li>
    </ul>

    <a class="item item-label margin no-lrborder positive padding-left4" ng-click="delete()">删除客户资料</a>
    <a class="item item-label margin no-lrborder positive padding-left4" ng-click="selectUser()">转给其他同事</a>
  </ion-content>
</ion-view>
